package cn.funeralobjects.ams.web.controller;

import cn.funeralobjects.ams.entity.EProduct;
import cn.funeralobjects.ams.model.Product;
import cn.funeralobjects.ams.service.BaseAmsService;
import cn.funeralobjects.ams.service.ProductService;
import cn.funeralobjects.ams.web.api.ProductApi;
import cn.funeralobjects.ams.web.mapper.ProductMapper;
import cn.funeralobjects.ams.web.model.MProduct;
import cn.funeralobjects.ams.web.model.VProduct;
import cn.funeralobjects.common.web.controller.converter.ModelMapper;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author FuneralObjects
 * Create date: 2020/5/26 10:24 AM
 */
@RestController
@RequestMapping("/product")
public class ProductController implements ProductApi, BaseAmsController<VProduct, MProduct, Product, EProduct, Integer> {

    @Resource
    private ProductService productService;
    @Resource
    private ProductMapper productMapper;

    @Override
    public BaseAmsService<Product, EProduct, Integer> baseAmsService() {
        return productService;
    }

    @Override
    public ModelMapper<MProduct, Product, EProduct, VProduct> modelMapper() {
        return productMapper;
    }
}
